package com.xbongbong.pro.form.pojo.dto;

import com.xbongbong.paas.domain.entity.ext.ConditionsEntityExt;
import com.xbongbong.paas.toolbox.wrap.BaseDTO;
import com.xbongbong.paas.toolbox.wrap.QueryIgnore;
import com.xbongbong.pro.es.pojo.EsScriptConditionPojo;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * @author chaoxiong.lei
 * @date 2019/2/14 19:36
 */
@Getter
@Setter
@ToString
public class EsDataDTO extends BaseDTO {
    /**
     * 业务类型
     */
    @NotNull(message = "{dto.msg.esData.businessType.NotNull}")
    private Integer businessType;

    /**
     * 表单id,多模板业务必传
     */
    @NotNull(message = "{dto.msg.esData.formId.NotNull}")
    private Long formId;

    /**
     * saas标记
     */
    @NotNull(message = "{dto.msg.esData.saasMark.NotNull}")
    private Integer saasMark;

    /**
     * 分页当前页
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private Integer page;

    /**
     * 分页每页记录数
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private Integer pageSize;

    /**
     * 模糊搜索
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private String nameLike;

    private Integer del;

    /**
     * 限制返回字段
     */
    @Getter(onMethod_ = {@QueryIgnore})
    List<String> fieldList;

    /**
     * es的查询条件
     */
    @Getter(onMethod_ = {@QueryIgnore})
    List<ConditionsEntityExt> conditionsEntityExtList;

    /**
     * es的should查询条件
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private List<List<ConditionsEntityExt>> shouldConditions = new ArrayList<>();

    /**
     * es脚本pojo
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private EsScriptConditionPojo esScriptPojo;

    /**
     * 排序字段{"field":"updateTime","sort":"asc"}
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private Map<String,String> sortMap;
    /**
     * 多表单限制
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private Boolean limitForms = false;

    /**
     * 多表单
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private List<Long> formIdList;

    /**
     * 导出为1
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private Integer fromExport;

}
